#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;
const int N = 110, M = N * N;
int n;
int p[N];
struct query
{
	int x, y;	
}q[N];
double fun(query a, query b)
{
	return sqrt((a.x - b.x) * (a.x - b.x) + ((a.y - b.y) * (a.y - b.y)));
}
struct node
{
	int a, b;
	double w;
}s[M];
int cnt;
double cmp(node a, node b)
{
	return a.w < b.w;
}
int find(int x)
{
	if (x != p[x])p[x] = find(p[x]);
	return p[x];
}
double ans;
bool kruskal()
{
	sort(s + 1, s + cnt + 1, cmp);
	for (int i = 1; i <= n; i++) {
		p[i] = i;
	}
	double ans = 0;
	int cnt1 = 0;
	for (int i = 1; i <= cnt; i++) {
		int a = s[i].a;
		int b = s[i].b;
		a = find(a);
		b = find(b);
		double w = s[i].w;
		if (a != b) {
			if (w >= 10 && w <= 1000) {
				ans += w * 100;
				p[a] = b;
				cnt1++;
			}
		}
	}
	if (cnt1 == n - 1)return 1;
	return 0;
}
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		memset(s, 0, sizeof(s));
		memset(p, 0, sizeof(p));
		memset(q, 0, sizeof(q));
		for (int i = 1; i <= n; i++) {
			int x, y;
			cin >> x >> y;
			q[i] = { x,y};
		}
		cnt = 0;
		ans = 0;
		for (int i = 1; i < n; i++) {
			for (int j = i + 1; j <= n; j++) {
				double w = fun(q[i], q[j]);
				s[++cnt] = { i,j,w };
			}
		}
		if (!kruskal()) {
			cout << "oh!" << endl;
		}
		else {
			printf("%.1lf\n", ans);
		}
		
	}
	return 0;
}